package com.haddonhillgroup.sample.rest;

import org.codehaus.jettison.json.JSONObject;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;

public class WpsClient {

	
	public void printTasks() {

		DefaultClientConfig cc = new DefaultClientConfig();
		
		Client c = Client.create(cc);
		
		HTTPBasicAuthFilter filter = new HTTPBasicAuthFilter("admin", System.getProperty("wps.password"));
		c.addFilter(filter);
		
		JSONObject tasks = (JSONObject) c.resource("http://192.168.1.144:9080/rest/bpm/htm/v1").path("tasks/filter").get(JSONObject.class);
		
		
			System.out.println(tasks);
		
		

		
		
	}
}
